﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

namespace Paas.Infrastructure.Data.Migrations
{
    public partial class metaFieldentityupdate : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "Length",
                table: "MetaField");

            migrationBuilder.DropColumn(
                name: "MetaFieldLength",
                table: "MetaField");

            migrationBuilder.RenameColumn(
                name: "FullName",
                table: "MetaField",
                newName: "Label");

            migrationBuilder.AlterColumn<string>(
                name: "ObjectId",
                table: "MetaField",
                type: "nvarchar(max)",
                nullable: true,
                oldClrType: typeof(Guid),
                oldType: "uniqueidentifier");

            migrationBuilder.AlterColumn<int>(
                name: "MetaFieldPrecision",
                table: "MetaField",
                type: "int",
                nullable: true,
                oldClrType: typeof(int),
                oldType: "int");
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.RenameColumn(
                name: "Label",
                table: "MetaField",
                newName: "FullName");

            migrationBuilder.AlterColumn<Guid>(
                name: "ObjectId",
                table: "MetaField",
                type: "uniqueidentifier",
                nullable: false,
                defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
                oldClrType: typeof(string),
                oldType: "nvarchar(max)",
                oldNullable: true);

            migrationBuilder.AlterColumn<int>(
                name: "MetaFieldPrecision",
                table: "MetaField",
                type: "int",
                nullable: false,
                defaultValue: 0,
                oldClrType: typeof(int),
                oldType: "int",
                oldNullable: true);

            migrationBuilder.AddColumn<int>(
                name: "Length",
                table: "MetaField",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<int>(
                name: "MetaFieldLength",
                table: "MetaField",
                type: "int",
                nullable: false,
                defaultValue: 0);
        }
    }
}
